import React from 'react';
import {
  ProjectOutlined,
  BlockOutlined,
  DashboardOutlined,
  SwitcherOutlined,
  ContainerOutlined,
  CreditCardOutlined,
  UserOutlined,
  UnlockOutlined,
} from '@ant-design/icons';

export interface MenuConfigItem {
  authority?: Array<string> | string // TODO: 权限控制，指定此菜单项需要的权限，设置时将覆盖掉默认权限
  children?: Array<MenuConfigItem> // 菜单子项
  name: string // 菜单项名称
  path: string // 菜单项对应的路由路径
  icon?: JSX.Element // antd 4.0 Icon 或自定义图片组件
  hide?: boolean // 是否在菜单中隐藏
}

// TODO: i18n
export const menuData: Array<MenuConfigItem> = [
  {
    name: 'Dashboard', // 工作台
    path: '/',
    icon: <DashboardOutlined />,
    children: [
      {
        name: 'My Profile',
        path: '/dashboard/profile',
        hide: true,
      },
      {
        name: 'Messages List',
        path: '/dashboard/messages',
        hide: true,
      },
      {
        name: 'Notification List',
        path: '/dashboard/notification',
        hide: true,
      },
    ],
  },
  {
    name: 'Project Pipeline', // 项目库
    path: '',
    icon: <ProjectOutlined />,
    children: [
      {
        name: 'Project List',
        path: '/project/list',
      },
      {
        name: 'My Project',
        path: '/project/my',
        children: [
          {
            name: 'New Project',
            path: '/project/new',
            hide: true,
          },
          {
            name: 'Edit Project',
            path: '/project/edit',
            hide: true,
          },
          {
            name: 'Project Details',
            path: '/project/details',
            hide: true,
          },
        ],
      },
      {
        name: 'Project spot check',
        path: '/project/check',
      },
    ],
  },
  {
    name: 'Case Library',
    path: '',
    icon: <SwitcherOutlined />,
    children: [
      {
        name: 'Case List',
        path: '/case/list',
      },
      {
        name: 'My cases',
        path: '/case/my',
        children: [
          {
            name: 'New Case',
            path: '/case/add',
            hide: true,
          },
          {
            name: 'Edit Case',
            path: '/case/edit',
            hide: true,
          },
          {
            name: 'Case Detail',
            path: '/case/detail',
            hide: true,
          },
        ],
      },
    ],
  },
  {
    name: 'Policy Library',
    path: '',
    icon: <ContainerOutlined />,
    children: [
      {
        name: 'Policy List',
        path: '/policy/list',
      },
      {
        name: 'My Policy',
        path: '/policy/my',
        children: [
          {
            name: 'New Policy',
            path: '/policy/add',
            hide: true,
          },
          {
            name: 'Edit Policy',
            path: '/policy/edit',
            hide: true,
          },
          {
            name: 'Policy Detail',
            path: '/policy/detail',
            hide: true,
          },
        ],
      },
    ],
  },
  {
    name: 'Private Sector', // 机构库
    path: '/institution/list',
    icon: <BlockOutlined />,
    children: [
      {
        name: 'New Sector',
        path: '/institution/add',
        hide: true,
      },
      {
        name: 'Edit Sector',
        path: '/institution/edit',
        hide: true,
      },
      {
        name: 'Sector Detail',
        path: '/institution/detail',
        hide: true,
      },
    ],
  },
  {
    name: 'News',
    path: '',
    icon: <ProjectOutlined />,
    children: [
      {
        name: 'News List',
        path: '/news/list',
      },
      {
        name: 'My News',
        path: '/news/my',
        children: [
          {
            name: 'New News',
            path: '/news/add',
            hide: true,
          },
          {
            name: 'Edit News',
            path: '/news/edit',
            hide: true,
          },
          {
            name: 'News Detail',
            path: '/news/detail',
            hide: true,
          },
        ],
      },
      {
        name: 'News Audit',
        path: '/news/audit',
      },
    ],
  },
  {
    name: 'Int\'l Experience', // 国际经验
    path: '',
    icon: <CreditCardOutlined />,
    children: [
      {
        name: 'Experience List',
        path: '/experience/list',
      },
      {
        name: 'My Expericence',
        path: '/experience/my',
        children: [
          {
            name: 'New Experience',
            path: '/experience/add',
            hide: true,
          },
          {
            name: 'Edit Experience',
            path: '/experience/edit',
            hide: true,
          },
          {
            name: 'Experience Detail',
            path: '/experience/detail',
            hide: true,
          },
        ],
      },
    ],
  },
  {
    name: 'Events',
    path: '',
    icon: <CreditCardOutlined />,
    children: [
      {
        name: 'Events List',
        path: '/events/list',
      },
      {
        name: 'My Events',
        path: '/events/my',
        children: [
          {
            name: 'New Events',
            path: '/events/add',
            hide: true,
          },
          {
            name: 'Edit Events',
            path: '/events/edit',
            hide: true,
          },
          {
            name: 'Events Details',
            path: '/events/details',
            hide: true,
          },
        ],
      },
    ],
  },
  {
    name: 'User Management',
    path: '/user/management',
    icon: <UserOutlined />,
    children: [
      {
        name: 'New User',
        path: '/user/add',
        hide: true,
      },
      {
        name: 'Edit User',
        path: '/user/edit',
        hide: true,
      },
    ],
  },
  {
    name: 'Role & Permission',
    path: '/permission/list',
    icon: <UnlockOutlined />,
    children: [
      {
        name: 'Add Permission',
        path: '/permission/add',
        hide: true,
      },
      {
        name: 'Edit Permission',
        path: '/permission/edit',
        hide: true,
      },
    ],
  },
];
